<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%product}}".
 *
 * @property integer $id
 * @property integer $company_id
 * @property string $product_name
 * @property string $product_price
 * @property string $product_cost_price
 * @property string $product_description
 * @property integer $product_is_hot
 * @property string $product_img
 * @property integer $created_at
 * @property integer $updated_at
 * @property integer $status
 */
class Product extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%product}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['company_id', 'product_is_hot', 'created_at', 'updated_at', 'status'], 'integer'],
            [['product_price', 'product_cost_price'], 'number'],
            [['product_description'], 'string'],
            [['product_name', 'product_img'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'company_id' => '单位ID',
            'product_name' => '产品名称',
            'product_price' => '出售价格',
            'product_cost_price' => '进货价格',
            'product_description' => '商品详情描述',
            'product_is_hot' => '是否标识为热点商品',
            'product_img' => '商品主图',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
            'status' => '是否上架',
        ];
    }
}
